<template>
  <el-card shadow="hover" class="quick-card">
    <div class="card-icon">
      <el-icon><component :is="icon" /></el-icon>
    </div>
    <h3>{{ title }}</h3>
    <p>{{ description }}</p>
    <el-button type="primary" class="card-btn" round @click="$emit('action')">
      {{ buttonText }}
    </el-button>
  </el-card>
</template>

<script setup>
defineProps({
  icon: {
    type: Object,
    required: true,
  },
  title: {
    type: String,
    required: true,
  },
  description: {
    type: String,
    required: true,
  },
  buttonText: {
    type: String,
    default: '立即查看',
  },
})

defineEmits(['action'])
</script>

<style scoped>
.quick-card {
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 20px;
}

.quick-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(64, 134, 244, 0.15) !important;
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f0f5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.card-icon .el-icon {
  font-size: 30px;
  color: #4086f4;
}

h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 10px;
  font-weight: normal;
}

p {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.card-btn {
  padding: 8px 20px;
}
</style>
